package com.lsm.sm.action;

/*import java.io.ByteArrayInputStream;
import java.io.InputStream;*/

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.lsm.sm.entity.User;
import com.lsm.sm.entity.UserEducation;
import com.lsm.sm.service.ProfileService;
import com.lsm.sm.util.Const;
import com.lsm.sm.util.WebUtil;

@Controller("profileAction")
@Scope("prototype")
public class ProfileAction{
	
	private User user;
	private UserEducation userEdu;
	//private InputStream stream;
	private String message;
	
	//@Resource
	private ProfileService profileService;
	
	//private BaseDao baseDao;
	public String basicProfile(){
		try {
			profileService.baseProfile( user, userEdu );
			setMessage( "更新成功&true" );
		} catch (Exception e) {
			System.out.println( e.getMessage() );
			setMessage( "抱歉！系统异常，请重试！" );
		}
		return Const.RST_BASPROF;
	}
	
	public String execute(){
		setUser( WebUtil.getUser() );
		return Const.SUCCESS;
	}
	
	public User getUser() {
		return user;
	}
	
	public void setUser(User user) {
		this.user = user;
	}

	public UserEducation getUserEdu() {
		return userEdu;
	}

	public void setUserEdu(UserEducation userEdu) {
		this.userEdu = userEdu;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
}
